package es.battleship.model;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;
import javax.xml.bind.annotation.XmlRootElement;

import com.google.appengine.api.datastore.Key;

@XmlRootElement
@PersistenceCapable
public class Cell {
	@PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Key id;
	
	@Persistent	
	private int x;
	
	@Persistent	
	private int y;
	
	@Persistent	
	private Boolean hit;
	
	@Persistent		
	private Ship ship;
	
	public Cell() {
	}
	
	


	public Key getId() {
		return id;
	}




	public void setId(Key id) {
		this.id = id;
	}




	public int getX() {
		return x;
	}




	public void setX(int x) {
		this.x = x;
	}




	public int getY() {
		return y;
	}




	public void setY(int y) {
		this.y = y;
	}




	public Boolean getHit() {
		return hit;
	}




	public void setHit(Boolean hit) {
		this.hit = hit;
	}




	public Ship getShip() {
		return ship;
	}




	public void setShip(Ship ship) {
		this.ship = ship;
	}




	public String toString() {
		return "Cell { id " 
				+ id 
				+ " x: " 
				+ x 
				+ " y: " 
				+ y 
				+ " status: " 
				+ hit
				+ " } ";

	}
}
